/*
 * Powered By [cciot base platform]
 * Web Site: http://www.cciot.net
 * Since 2012 - 2013
 */

package net.cciot.platform.core.dao;

import java.io.*;
import java.net.*;
import java.util.*;

import java.math.BigDecimal;
import java.math.BigInteger;

import net.cciot.platform.common.base.*;

import static net.cciot.platform.common.util.DateFormats.*;
import static net.cciot.platform.common.util.GlobalMessages.*;
import static net.cciot.platform.common.util.SpringMVCUtils.toModelMap;
import static net.cciot.platform.common.util.MybatisPageQueryUtils.pageQuery;

import static cn.org.rapid_framework.util.ValidationErrorsUtils.convert;
import static cn.org.rapid_framework.beanutils.BeanUtils.copyProperties;
import static cn.org.rapid_framework.util.holder.BeanValidatorHolder.validateWithException;
import cn.org.rapid_framework.util.DateConvertUtils;

import cn.org.rapid_framework.page.PageRequest;
import cn.org.rapid_framework.page.Page;

import net.cciot.platform.core.model.*;
import net.cciot.platform.core.dao.*;
import net.cciot.platform.core.service.*;
import net.cciot.platform.core.query.*;


import org.springframework.stereotype.Repository;

/**
 * @author anduo email:anduo1989@gmail.com
 * @version 1.0
 * @since 1.0
 */
@Repository
public class BaseUsersDao extends BaseMybatisDao<BaseUsers,java.lang.String>{
	
	@Override
	public String getMybatisMapperNamesapce() {
		return "BaseUsers";
	}
	
	public void saveOrUpdate(BaseUsers entity) {
		if(entity.getUserId() == null) 
			save(entity);
		else 
			update(entity);
	}
	
	public Page findPage(BaseUsersQuery query) {
		return pageQuery(getSqlSession(),"BaseUsers.findPage",query);
	}
	

}
